#pragma once

#include <Crawler/PluginRoot.h>
#include <Crawler/Plugin.h>
#include <Crawler/AbstractDataProcessor.h>





class EMailProcessor
	: public PluginRoot
	, public AbstractDataProcessor
{
private:

	static const QString m_name;
	static const QString m_version;
	static const QString m_description;

private:

	bool            m_enabled;

	QRegExp         m_rx;
	QSet<QString>   m_emails;

public:

	EMailProcessor();



	/**
	 * Get the name of the Filter.
	 * @see Plugin::name
	 */
	QString name() const;

	/**
	 * Get a formatted version string.
	 * @see Plugin::version
	 */
	QString version() const;

	/**
	 * Get a description of the Filter.
	 * @see Plugin::description
	 */
	QString description() const;



	/**
	 * Process the given reply.
	 */
	void process( const Reply &reply );



	/**
	 * Enable the plugin.
	 * @see Plugin::enable
	 */
	void enable();

	/**
	 * Disable the plugin.
	 * @see Plugin::disable
	 */
	void disable();



	/**
	 * Test if the plugin is enabled or not.
	 * @see Plugin::enabled
	 */
	bool enabled() const;

	/**
	 * Test if the plugin is disabled or not.
	 * @see Plugin::disabled
	 */
	bool disabled() const;
};
///////////////////////////////////////////////////////////////////////////////////////////////////




extern "C" __declspec( dllexport ) PluginRoot *createPlugin();
extern "C" __declspec( dllexport ) void releasePlugin( PluginRoot *object );
